
<?php
$saveOrder = ($ordering=='ordering');
?>
<?= formOpen(site_url('admin/user/index'), 'post', 'id="adminForm" class="formAjax"') ?>
	<div class="table-responsive">
		<table class="table table-hover table-striped" id="tableList">
			<thead>
				<tr>
					<th width="1%" class="text-center nowrap"><?= filtersort($link, lang('status'), 'status', $direction, $ordering) ?></th>
					<th><?= filtersort($link, lang('name'), 'fullname', $direction, $ordering) ?></th>
					<th><?= filtersort($link, lang('email'), 'email', $direction, $ordering) ?></th>
					<th><?= filtersort($link, lang('group'), 'group_id', $direction, $ordering) ?></th>
					<th><?= filtersort($link, lang('user_last_login'), 'last_login', $direction, $ordering) ?></th>
					<th width="1%" class="text-center nowrap"><?= filtersort($link, lang('id'), 'id', $direction, $ordering) ?></th>
					<th width="1%" class="text-center nowrap"><span class="sr-only"><?= lang('delete') ?></span></th>
				</tr>
			</thead>
			<tfoot>
				<tr>
					<td colspan="9" class="text-center">
						<nav>
							<?php echo $this->pagination->create_links(); ?>
						</nav>
					</td>
				</tr>
			</tfoot>
			<tbody class="sortable">
			<?php $order = array();
			foreach($items as $k=>$item): ?>
				<tr data-id="<?= $item->id ?>">
					<td width="1%" class="text-center">
						<a href="<?= site_url('admin/user/toggle/status/'.$item->id.'/'.(1-$item->status)) ?>" class="btn btn-default btn-micro hasTip toggle linkAjax" title="<?= lang('toggle_to_publish') ?>"><i class="icon-<?php if(!$item->status) echo 'un' ?>publish"></i></a>
					</td>
					<td><?= anchor(site_url('admin/user/form/'.$item->id), $item->fullname) ?></td>
					<td><?= $item->email ?></td>
					<td><?= $item->group ?></td>
					<td><?= mdate(lang('date_format_lc'), strtotime($item->last_login)) ?></td>
					<td width="1%" class="text-center"><?= $item->id ?></td>
					<td width="1%" class="text-center">
						<a href="<?= site_url('admin/user/delete/'.$item->id) ?>" class="btn btn-default btn-micro hasTip linkAjax" title="<?= lang('delete_this') ?>" data-confirm="<?= lang('sure_delete_this') ?>"><i class="icon-trash"></i></a>
					</td>
				</tr>
			<?php endforeach ?>
			</tbody>
		</table>
	</div>
	<div id="data-ordering" data-ordering="<?= implode(',',$order); ?>"></div>
<?= formClose() ?>
